package com.runa.persistence.repository;

import com.runa.monitor.comm.entity.CommNetService;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;


@Repository
public interface CommNetServiceRepository extends JpaRepository<CommNetService, Integer> {

//    @Query(value = "update comm_net_service IF(ISNULL(:name), ,set name=:name), " +
//            " IF(ISNULL(:port), ,set port=:port)," +
//            " IF(ISNULL(:protocol), ,set protocol=:protocol)," +
//            " IF(ISNULL(:type), ,set type=:type)," +
//            " IF(ISNULL(:enable), ,set enable=:enable) " +
//            " where id=:id"
//            , nativeQuery = true)
////    void updateNa(@Param("id")Integer id,@Param("name")String name);
//    void updateNa(@Param("id")Integer id,@Param("name")String name,@Param("port") Integer port
//            ,@Param("protocol") String protocol
//            ,@Param("type") String type,@Param("enable") Integer enable);

//    @Query(value = "update comm_net_service IF(ISNULL(:name),'',set name=:name) " +
//            " IF(ISNULL(:port), '',,set port=:port)" +
//            " where id=:id"
//            , nativeQuery = true)
////    void updateNa(@Param("id")Integer id,@Param("name")String name);
//    void updateNa(@Param("id")Integer id,@Param("name")String name,@Param("port") Integer port
//            );
}
